package com.szrt.javaweb;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class HelloServletContextListener implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		
		//当ServletContext对象被创建时，也就是当前web  appliation被加载到服务器中被创建  或者某个类被重新编译时
		
		//在所有的filter和servlet之前执行
		System.out.println("ServletContext 对象被创建..." +sce.getServletContext());
		
		
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		
		System.out.println("ServletContext 对象被销毁..."+sce.getServletContext());

	}

}
